<template>
  <div>
    <!-- 顶部栏 -->
    <van-nav-bar
      title="商品搜索"
      left-arrow
      fixed
      @click.left.native="$router.go(-1)"
    >
      <!-- 右侧预留插槽 -->
      <!-- <template #right>
    <van-icon name="" size="18" />
  </template> -->
    </van-nav-bar>
    <form action="/">
      <van-search
        v-model="value"
        show-action
        placeholder="请输入搜索关键词"
        @search="onSearch"
        @cancel="onCancel"
      />
    </form>
  </div>
</template>

<script>
export default {
  data() {
    return {
      value: "",
    };
  },
  methods: {
    onSearch(val) {
      Toast(val);
    },
    onCancel() {
      Toast("取消");
    },
  },
};
</script>

<style lang="scss" scoped>
form{
    margin-top: 46px;
}
</style>